<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | Dashboard</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">


    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">

    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" th:href="@{/bower_components/bootstrap/dist/css/bootstrap.min.css}" type="text/css">

    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/bower_components/font-awesome/css/font-awesome.min.css}" type="text/css">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/bower_components/Ionicons/css/ionicons.min.css}" type="text/css">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/dist/css/AdminLTE.min.css}" type="text/css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/dist/css/skins/_all-skins.min.css}" type="text/css">
    <!-- Morris chart -->
    <link rel="stylesheet" th:href="@{/bower_components/morris.js/morris.css}" type="text/css">
    <!-- jvectormap -->
    <link rel="stylesheet" th:href="@{/bower_components/jvectormap/jquery-jvectormap.css}" type="text/css">
    <!-- Date Picker -->
    <link rel="stylesheet" th:href="@{/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css}"
          type="text/css">
    <!-- Daterange picker -->
    <link rel="stylesheet" th:href="@{/bower_components/bootstrap-daterangepicker/daterangepicker.css}" type="text/css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" th:href="@{/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css}" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

    <header class="main-header">
        <div th:include="common/head :: head"></div>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">

            <div th:include="common/left :: left"></div>
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">

        <h2 class="profile-username text-center">审核课程</h2>

        <!-- Main content -->
        <section class="content">
            <!-- /.row -->
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="info-box">
                        <span class="info-box-icon "><img th:src="${course.getImgpath()}"></span>
                        <div class="info-box-content">
                            <span class="info-box-number"><h3 th:text="'课程名：'+${course.coursename}"></h3></span>
                            <span class="info-box-number"><h4 th:text="'创建时间：'+${course.createtime}"></h4></span>
                        </div>
                        <!-- /.info-box-content -->

                    </div>
                    <!-- /.info-box -->
                    <!--网这下面加内容-->
                    <div>
                        <h4 class="text-center">章节目录</h4>
                        <!-- Default box   courseChaptersmaps-->
                        <div class="box" th:each="m:${courseChaptersmaps}">
                            <div class="box-header with-border">
                                <h3 class="box-title" th:each="entry:${m}"
                                    th:text="'第'+${mStat.index+1}+'章：  '+${entry.key}">Title</h3>

                                <div class="box-tools pull-right">
                                    <button type="button" class="btn btn-box-tool" data-widget="collapse"
                                            data-toggle="tooltip"
                                            title="Collapse">
                                        <i class="fa fa-minus"></i></button>
                                </div>
                            </div>
                            <div class="box-body">

                                <div th:each="entryvalue : ${m}">
                                    <ul th:each=" kejie :${entryvalue.value}">
                                        <a th:href="@{/seevideo(href=${kejie.getContenturl()})}" target="_blank">
                                            <li th:text="'第'+${kejieStat.index+1}+'节：  '+${kejie.contentname}"></li>
                                        </a>
                                    </ul>

                                </div>

                            </div>
                            <!-- /.box-body -->
                        </div>
                        <!-- /.box -->


                    </div>
                    <button type="button" class="btn btn-success  btn-block" name="backid"
                            id="true">审核通过
                    </button>
                    <button type="button" class="btn btn-danger  btn-block" name="backid"
                            id="false">审核未通过
                    </button>

                    <button type="button" class="btn btn-info  btn-block" name="backid"
                            id="backid">返回列表
                    </button>


                </div>
                <!--row end-->
                <!-- Default box -->
            </div>

            <!-- /.row -->


        </section>
        <!-- /.content -->


    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">
        <div th:include="common/footer :: footer"></div>
    </footer>
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script th:src="@{/bower_components/jquery/dist/jquery.min.js}" type="text/javascript"></script>
<!-- jQuery UI 1.11.4 -->
<script th:src="@{/bower_components/jquery-ui/jquery-ui.min.js}" type="text/javascript"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/bower_components/bootstrap/dist/js/bootstrap.min.js}" type="text/javascript"></script>
<!-- Morris.js charts -->
<script th:src="@{/bower_components/raphael/raphael.min.js}" type="text/javascript"></script>
<script th:src="@{/bower_components/morris.js/morris.min.js}" type="text/javascript"></script>
<!-- Sparkline -->
<script th:src="@{/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js}" type="text/javascript"></script>
<!-- jvectormap -->
<script th:src="@{/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js}" type="text/javascript"></script>
<script th:src="@{/plugins/jvectormap/jquery-jvectormap-world-mill-en.js}" type="text/javascript"></script>
<!-- jQuery Knob Chart -->
<script th:src="@{/bower_components/jquery-knob/dist/jquery.knob.min.js}" type="text/javascript"></script>
<!-- daterangepicker -->
<script th:src="@{/bower_components/moment/min/moment.min.js}" type="text/javascript"></script>
<script th:src="@{/bower_components/bootstrap-daterangepicker/daterangepicker.js}" type="text/javascript"></script>
<!-- datepicker -->
<script th:src="@{/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js}"
        type="text/javascript"></script>
<!-- Bootstrap WYSIHTML5 -->
<script th:src="@{/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js}" type="text/javascript"></script>
<!-- Slimscroll -->
<script th:src="@{/bower_components/jquery-slimscroll/jquery.slimscroll.min.js}" type="text/javascript"></script>
<!-- FastClick -->
<script th:src="@{/bower_components/fastclick/lib/fastclick.js}" type="text/javascript"></script>
<!-- AdminLTE App -->
<script th:src="@{/dist/js/adminlte.min.js}" type="text/javascript"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script th:src="@{/dist/js/pages/dashboard.js}" type="text/javascript"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/dist/js/demo.js}" type="text/javascript"></script>


<script type="text/javascript">
    $(function () {
        $('.sidebar-menu li:not(.treeview) > a').on('click', function () {
            console.log(this.href);
            var $parent = $(this).parent().addClass('active');
            $parent.siblings('.treeview.active').find('> a').trigger('click');
            $parent.siblings().removeClass('active').find('li').removeClass('active');
        });
        $('.sidebar-menu a').each(function () {
            if (this.href === window.location.href) {
                $(this).parent().addClass('active')
                    .closest('.treeview-menu').addClass('.menu-open')
                    .closest('.treeview').addClass('active');
            }
        });
    });

</script>
<script type="text/javascript" th:inline="javascript">
    var courseid = [[${course.courseid}]];

    $(function () {
        $('#backid').click(function () {
            window.location.href = "/checkback";
        });
        $('#true').click(function () {
            $.ajax({
                url: "/updatestatus",
                data:{"courseid":courseid,"coursestatusid":4},
                type: "POST",
                success: function (result) {
                    if(result!="0"){
                        alert("审核完成！");
                        $('#true').next().hide();
                        $('#true').hide();

                    }else{
                        alert("审核失败，请重新提交！")
                    }
                }
            });
        });


        $('#false').click(function () {

            $.ajax({
                url: "/updatestatus",
                data:{"courseid":courseid,"coursestatusid":3},
                type: "POST",
                success: function (result) {
                    if(result!="0"){
                        alert("审核完成！");
                        $('#false').prev().hide();
                        $('#false').hide();

                    }else{
                        alert("审核失败，请重新提交！")
                    }
                }
            });

        })
    })

</script>
</body>
</html>
